1. Field of the Invention
The present invention generally relates to data processing and more particularly to gathering coverage data for program code.
2. Description of the Related Art
Development of software requires frequent testing and debugging. One aspect of testing is collecting coverage data. Coverage data includes a variety of statistics for the program being tested. Today, coverage data is often collected by code coverage tools which identify which statements of a program being tested have been executed. Utilizing code coverage tools requires a user to instrument their program first and then collect coverage data while running the various tests. Instrumentation involves replacing opcodes at the beginning of each statement such that when the statement is executed a trap occurs. The code coverage tool catches the trap and notes that the statement has been covered by marking it as such in a data file.
One disadvantage of the foregoing approach is that code coverage is performed for an entire program, rather than a particular piece of code. Thus, a user must collect coverage data for each program containing a particular piece of code, even though the user is interested only in that particular piece of code.
The disadvantages of the foregoing approach are even greater in a multiuser software development environment. Specifically, while coverage data may be collected for each of the various developers of a particular team of developers, a comprehensive picture of what code has been covered by the team is not possible. Though some code coverage tools do allow developers to merge coverage data from several runs, this is a time-consuming process. Also, merging coverage data does nothing to reduce the instrumentation burden since the programs must be fully instrumented every time coverage data is to be collected. Further, isolating the use of shared library routines and obtaining associated coverage data can be difficult, especially when the routines are bound to various test programs. Using conventional code coverage tools, obtaining coverage data for such shared library routines requires that each user of the development team collect and merge coverage data each time a program is run and further requires that the merged coverage data for each user is merged with the coverage data collected by the other users of the development team.
Therefore, there is a need for a system and method which allows for collecting coverage data in a manner which overcomes the foregoing disadvantages.